<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        let str = "崽崽";
        let str1 = str.padStart(3,0);
        console.log(str1);

        let str2 = str.padEnd(3,"0");
        console.log(str2);

        let str3 = str.padStart(3,"哈哈哈");
        console.log(str3);

        let str4 = str.padEnd(4,"哈哈哈");
        console.log(str4);

        let id = "111111111111221212"
        function fn(idNum){
            let last = idNum.slice(-6);
            let code = last.padStart(18,"*");
            return code;
        }
        console.log(fn(id))
        // console.log(id.padEnd(19,"*"))
        function fn1(ID){
            let a = ID.slice(12);
            let b = a.padStart(18,"*");
            return b ;
        }
        console.log(fn1(id))

        setInterval(function(){
            let date = new Date();
            let s = date.getSeconds()+"";
            console.log(s.padStart(2,"0"))
        },1000)

        setInterval(function(){
            let date1 = new Date;
            let a = date1.getSeconds()+"";
            console.log(a.padStart(2,"0"))
        },1000)
    </script>
</body>
</html>